Support ControlNet for Qwen-Image-Edit#12325
Support ControlNet for Qwen-Image-Edit#12325dimitribarbot wants to merge 10 commits intohuggingface:mainfrom
Conversation
|
The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update. |
yiyixuxu
left a comment
There was a problem hiding this comment.
thanks! i left some comments
didn't know the instant x controlnet is compatible with qwen edit :)
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
src/diffusers/pipelines/qwenimage/pipeline_qwenimage_edit_controlnet.py
Outdated
Show resolved
Hide resolved
| interval_control = len(self.transformer_blocks) / len(controlnet_block_samples) | ||
| interval_control = int(np.ceil(interval_control)) | ||
| hidden_states = hidden_states + controlnet_block_samples[index_block // interval_control] | ||
| sample = controlnet_block_samples[index_block // interval_control] |
There was a problem hiding this comment.
can we adjust inputs in pipeline instead?
There was a problem hiding this comment.
I added sample padding to the pipeline and rolled back that change. Let me know if that works for you.
|
Thank you for your code review. In fact, for my PR, I only merged the
Your feedback is all valid, and I can address it in my PR. However, this feedback also applies to the other Qwen-Image pipelines. Given that there is already a complete refactoring PR #12322, what would you prefer me to do:
|
|
hi @dimitribarbot
if it is refering to the remove of my review is not taking into consideration of this PR # #12322 at all, your PR will probably be merged first, and we can solve the conflicts from the other PR if there is any |
a603407 to
195bddd
Compare
|
hi @yiyixuxu
The removal of the For your comment in the
Would you prefer me to revert the changes to |
|
@dimitribarbot thanks for this PR. You can completely disregard #12322 for now. We're still brainstorming it (hence it's WIP). |
9866325 to
5b1c134
Compare
…nd vae slicing functions
c27603c to
301e722
Compare
|
Not sure if this PR still makes sense since QwenImageEdit Plus now natively supports ControlNet. |
|
I'm closing it for now. Can be reopened if necessary. |
|
Thanks for your understanding and appreciate the efforts! |
What does this PR do?
Add ControlNet (InstantX/Qwen-Image-ControlNet-Union) support for Qwen-Image-Edit.
This pipeline enables two latent images to be used as inputs: one for Qwen-Image-Edit and another for Qwen-Image-ControlNet-Union. This provides greater control over the expected results.
Inference
N.B.1. If this PR and image location are accepted, I will upload the
living_room.pngfile to thedocumentation-imagesrepository.N.B.2. To achieve the desired result, set
controlnet_conditioning_scaleto a value greater than 1. A good starting point is 1.5.Examples
Depth
Input image:
Control image:
Result:
Pose
Input image:
Control image:
Result:
Whereas if we don't use controlnet:
N.B. All examples were created using the Nunchaku version of the transformer.
Before submitting
documentation guidelines, and
here are tips on formatting docstrings.
Who can review?
@yiyixuxu
@asomoza